from __future__ import annotations

from dataclasses import dataclass


@dataclass
class TransportCheck:
    width_ok: bool
    height_ok: bool
    weight_ok: bool
    lane_ok: bool
    note: str


def check_heavy_transport(load_width_m: float, load_height_m: float, load_weight_t: float, road_limit_width_m: float, road_limit_height_m: float, axle_limit_t: float, num_axles: int, lane_width_m: float) -> TransportCheck:
    """大件运输校核：通行尺寸与轴荷限制。"""

    width_ok = load_width_m <= road_limit_width_m and load_width_m <= lane_width_m
    height_ok = load_height_m <= road_limit_height_m
    weight_ok = load_weight_t <= axle_limit_t * max(1, num_axles)
    lane_ok = load_width_m <= 0.9 * lane_width_m
    return TransportCheck(width_ok=width_ok, height_ok=height_ok, weight_ok=weight_ok, lane_ok=lane_ok, note="如不满足，需办理超限审批与线路勘查")


